<template>
  <div id="app">
    <div>
      <button>我是父组件，我的值是{{ dataFromSon }}</button>
      <button @click="reStart">重置</button>
    </div>
    <myCount ref='mycount' @add="add"></myCount>
  </div>
</template>

<script>
export default {
  data() {
    return {
      dataFromSon: 0
    }
  },
  methods: {
    add(val) {
      this.dataFromSon++
    },
    reStart() {
      this.dataFromSon = 0
      this.$refs.mycount.$refs.myLeft.count = 0
      this.$refs.mycount.$refs.myRight.count = 0
      this.$refs.mycount.$refs.myLeft.rightCount = 0
      this.$refs.mycount.$refs.myRight.leftCount = 0
    }
  },
  watch: {},
  computed: {},
  filters: {},
}
</script>

<style lang="less">
// #app{
//   flex: 1;
// }
</style>
